package lhdx7;

public class Yuan {
    private int r;
    public static double pi = 3.14;

    public void setR(int r) {
        if (r > 0) {
            this.r = r;
            return;
        } else {
            System.out.println("输入错误！");
        }

    }

    public int getR() {
        this.r = r;
        return r;
    }
    public double mianj(){
        double mian=pi*r*r;
        System.out.println("面积:"+mian);
        return mian;
    }
    public double zhouc(){
         double  zhou=pi*r*2;
        System.out.println("周长:"+zhou);
        return zhou;
    }

}
